﻿namespace AutoRegisterInject;

internal sealed class SourceConstants
{
    internal const string GENERATE_ATTRIBUTE_SOURCE = @"// <auto-generated>
//     Automatically generated by AutoRegisterInject.
//     Changes made to this file may be lost and may cause undesirable behaviour.
// </auto-generated>
[System.AttributeUsage(System.AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
internal sealed class RegisterScopedAttribute : System.Attribute { }
[System.AttributeUsage(System.AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
internal sealed class RegisterSingletonAttribute : System.Attribute { }
[System.AttributeUsage(System.AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
internal sealed class RegisterTransientAttribute : System.Attribute { }
[System.AttributeUsage(System.AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
internal sealed class RegisterHostedServiceAttribute : System.Attribute { }";

    internal static string GENERATE_SCOPED_SOURCE = "serviceCollection.AddScoped<{0}>();";
    internal static string GENERATE_SCOPED_INTERFACE_SOURCE = "serviceCollection.AddScoped<{0}, {1}>();";
    internal static string GENERATE_SINGLETON_SOURCE = "serviceCollection.AddSingleton<{0}>();";
    internal static string GENERATE_SINGLETON_INTERFACE_SOURCE = "serviceCollection.AddSingleton<{0}, {1}>();";
    internal static string GENERATE_TRANSIENT_SOURCE = "serviceCollection.AddTransient<{0}>();";
    internal static string GENERATE_TRANSIENT_INTERFACE_SOURCE = "serviceCollection.AddTransient<{0}, {1}>();";
    internal static string GENERATE_HOSTED_SERVICE_SOURCE = "serviceCollection.AddHostedService<{0}>();";

    internal const string GENERATE_CLASS_SOURCE = @"// <auto-generated>
//     Automatically generated by AutoRegisterInject.
//     Changes made to this file may be lost and may cause undesirable behaviour.
// </auto-generated>
using Microsoft.Extensions.DependencyInjection;
public static class AutoRegisterInjectServiceCollectionExtension
{
    public static Microsoft.Extensions.DependencyInjection.IServiceCollection AutoRegisterFrom{0}(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection)
    {
        return AutoRegister(serviceCollection);
    }

    internal static Microsoft.Extensions.DependencyInjection.IServiceCollection AutoRegister(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection)
    {
        {1}
        return serviceCollection;
    }
}";
}